//
//  UITextField+Placholder.m
//  UserUse
//
//  Created by angra on 16/10/15.
//  Copyright © 2016年 CJPC. All rights reserved.
//

#import "UITextField+Placholder.h"

@implementation UITextField (Placholder)
-(void)setPlaceholder:(NSString *)placeholder
{
    self.attributedPlaceholder = [[NSAttributedString alloc]initWithString:placeholder attributes:@{
                                                                                                    NSForegroundColorAttributeName:[UIColor colorWithHexString:@"cccccc"]}];
    objc_setAssociatedObject(self, @selector(placeholder), placeholder, OBJC_ASSOCIATION_RETAIN_NONATOMIC);

}
-(NSString *)placeholder
{
    return objc_getAssociatedObject(self, @selector(placeholder));
}
@end
